package com.wc.AlgoOJ_train.train1.c6.A615;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2024/1/10 20:42
 * @description 字符替换
 * http://43.138.190.70:8888/p/A615
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        String s = sc.next();
        char[] chs = s.toCharArray();
        while (m-- > 0) {
            int idx = sc.nextInt();
            char c = sc.next().charAt(0);
            chs[idx - 1] = c;
        }
        System.out.println(new String(chs));
    }
}
